#!/bin/bash

# generate crypto
# generate certificate configuration
cryptogen generate --config=./crypto-config.yaml
# generate genesis block
configtxgen -profile SampleMultiNodeEtcdRaft \
-channelID multiple-deployment-channel \
-outputBlock ./channel-artifacts/genesis.block
# generate channel configuration
configtxgen -profile FourOrgsChannel \
-outputCreateChannelTx ./channel-artifacts/channel.tx \
-channelID mychannel
# generate org{1..4}'s anchors
for i in {1..4}
do
    configtxgen -profile FourOrgsChannel \
    -outputAnchorPeersUpdate ./channel-artifacts/Org${i}MSPanchors.tx \
    -channelID mychannel -asOrg Org${i}MSP
done